home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 1 Issue 2 / PDCD-1 - Issue 02.iso / _utilities / utilities / 003 / _gs / !GS / !Help next >
Text File  |  1991-12-06  |  13KB  |  278 lines

  1. GhostScript for the Archimedes
  2. ==============================
  3.  
  4. Version: GS 2.2/Arc-2
  5.  
  6. !GS is a port of the public domain GhostScript interpreter to the
  7. Archimedes. GhostScript is a page definition language closely resembling
  8. PostScript (TM). See other documents included in the release for its history
  9. and features. The port was carried out by David Elworthy.
  10.  
  11. Requirements
  12. ------------
  13. !GS was developed on on A440. I haven't tried it on any other platforms. If
  14. you have problems, let me know. I don't promise to do anything about them,
  15. but I will try to take note for the next release.
  16.  
  17. Shared C library version 3.75 is needed for !GS. This is included in Acorn's
  18. C release 4, and has also been released on the net; you should be able to
  19. get it from the Newcastle info server. Try reading comp.sys.acorn if you
  20. don't know of this.
  21.  
  22.  
  23. Background
  24. ----------
  25. The GhostScript language is a variant of PostScript (TM), a programming
  26. language used principally for defining graphic images. !GS in an interpreter
  27. for this language, which makes the graphic output available in the form of a
  28. sprite. You can use !GS as a way of interpreting files of GhostScript
  29. commands, or you can interactively type in commands. Most users won't need
  30. to know anything about the language, but if you're interested, have a look
  31. in the file doc.language.
  32.  
  33. The output of GhostScript is a page image in some form appropriate to the
  34. platform it is running on. Some implementations allow output to more than
  35. one device type. Devices which have been implemented include various PC
  36. display formats, X windows and miscellaneous printers.
  37.  
  38. GhostScript is normally a command line program, using the standard I/O
  39. streams (stdin, stdout, stderr in Unix terms) for communication with the
  40. user, and some appropriate display for the output device. For example, Under
  41. Unix with X windows, it runs as a Unix command, opening an X window for the
  42. display device.
  43.  
  44.  
  45. Using !GS
  46. ---------
  47. !GS starts by placing an icon on the icon bar. You can execute a GhostScript
  48. file by dropping it on the icon. The resulting "page" will be shown in a
  49. window once the file has been executed; more on this below.
  50.  
  51. The icon bar menu has the following entries:
  52.  Info => information about !GS
  53.  Options => device options box
  54.  Fast
  55.  Show page
  56.  Quit
  57.  
  58. The device options box allows you to change the size of the output page, and
  59. the output resolution. You can also set "save only" mode, in which case the
  60. page is not displayed, and instead you get a save box for the output sprite.
  61. The options are only changed if you click "Set". When "Fast" is set, then
  62. !GS does not co-operate over multitasking, and blocks out other applications
  63. while it executes a  command or file. When unset (the default), other
  64. applications can run concurrently, at the cost of slowing !GS down. "Show
  65. page" issues a GhostScript "showpage" command, which displays the current
  66. output page, or just the save box if "save only" is set. This is useful if
  67. you wanted to save the output, but lost the save box. "Quit" closes !GS
  68. down.
  69.  
  70. The output page is displayed in its own window. The menu for this window
  71. consists of "Save", "Zoom", which leads you to a standard zoom dialogue box,
  72. and "Zoom x 1", which resets the zoom factor to 1:1. The main menu is
  73. disabled while the page window is up, and GhostScript commands are not
  74. executed. When you've finished with the page window, click on the close icon
  75. to remove it.
  76.  
  77. If you want to enter commands, or to see output messages from the !GS
  78. interpreter, click select on the icon. Two windows are opened. The larger
  79. one is for !GS output, and the smaller one (the read window) for input. Both
  80. have menus, which are identical to the icon menu, and you can drop files in
  81. the read window to execute them. If the page window is displayed, then
  82. commands which you type in are not executed until it is removed.
  83.  
  84. A system variable, GS$Options, may be used to set the default options for
  85. !GS. It consists of five numbers, four floats and an integer. The first two
  86. are the width and height for the output image, in inches. The third and
  87. fourth are the horizontal and vertical resolutions in pixels per inch. If
  88. the variable is not set, or if a parameter is given as less than or equal to
  89. zero, a default is used. The defaults are A4 size image, at 180 pixels per
  90. inch. The final number sets "save only" mode, if non-zero.
  91.  
  92.  
  93.  
  94. To see it working ...
  95. ---------------------
  96. Double click on !GS. The take the file "golfer" from the "ps" directory in
  97. !GS, and drop it on the icon. This takes a while to execute, but eventually
  98. you will get a page window. See the information in "doc" for some other
  99. GhostScript files to try.
  100.  
  101.  
  102. Modifying !GS
  103. -------------
  104. There are two reasons why you might want to modify !GS: to change the
  105. implementation I have provided, and to add other device drivers. The
  106. standard GhostScript release comes with code to produce output for a large
  107. variety of printers and display devices; see "doc.drivers" for details.
  108.  
  109. To do the build itself, use the file Arc-Make with Acorn's AMU. I have been
  110. using C release 4, and I have no idea if Arc-Make will work with earlier
  111. versions of C. The target you need to build is !RunImage. You will need to
  112. change the symbols RLIB and WIMPPLUS in Arc-Make. RLIB points to the
  113. RISC_OSLib directory. WIMPPLUS points to a directory containing my own
  114. WimpPlus library, which is supplied with the !GS release. You'll get lots of
  115. warnings on compiling, but they can be safely ignored. Set the current
  116. directory to !GS's directory before using Arc-Make.
  117.  
  118. Most of the Archimedes specific code is in c.gp_arc, c.gdevarc and
  119. c.gdevarc1. The latter two files contain the code for generating sprite
  120. output. gp_arc is intended to be independent of which output device you are
  121. using, and does all the work of handling the main menu, and the read and
  122. print windows; this includes such things as dropping files on the icon or
  123. window. If you decide you want output to some other device, then keep
  124. c.gp_arc and replace c.gdevarc and c.gdevarc1 with whatever other device
  125. driver you want. The header h.gp_arc gives some hints on how to use it with
  126. other devices. The main things you are likely to need to know are that you
  127. can register a function for setting device specific options from the menu
  128. (replacing the device options dbox described above), and a flag which tells
  129. you if you are in fast mode or not. Ideally, the device driver should check
  130. this flag from time to time, and call wimpc_checkpoint if it is set.
  131.  
  132.  
  133. File naming
  134. -----------
  135. I have modified the file reading routines in GhostScript so that they
  136. translate some file names into form which is more natural for the
  137. Archimedes. Specifically, any file names of the form foo.name.ps or
  138. foo.name.gsf are translated into foo.ps.name or foo.gsf.name. The former is
  139. used for GhostScript files. The files in gsf are font files. Unfortunately,
  140. it would be hard to make use of the Archimedes font manager, so you're stuck
  141. with what they supply. If you are short of space, you can get rid of these,
  142. with the exception of "uglyr", which is used if no other font can be found.
  143.  
  144.  
  145. PrinterPS output
  146. ----------------
  147. GhostScript usually falls over on output from !PrinterPS. This is because
  148. output from PrinterPS (from some programs at least) lists all the fonts
  149. known to the system. GhostScript tries to load them all, even if they are
  150. not used, and runs out of memory. I'm not sure if this is a problem with
  151. Acorn applications, with PrinterPS or with GhostScript - I just don't
  152. understand the PostScript well enough to say. To get round this problem, try
  153. deleting the lines in PrinterPS output files which look like:
  154.   /Corpus.Medium /Courier Latin1Enc FF
  155. except (of course) for fonts actually used in the document!
  156.  
  157. GhostScript does support colour, but don't forget that you have to set up
  158. PrinterPS for colour printing first.
  159.  
  160. Comments
  161. --------
  162. If you run a PostScript file containing several pages (i.e. several
  163. "showpage" commands), then the page window is displayed for each one in
  164. turn. Close the window to start processing the next page.
  165.  
  166. During rendering, input into the command line window is buffered. The icon
  167. bar and command window menus are disabled (and, further, will be closed even
  168. if you use Adjust to choose from them).
  169.  
  170. GS puts out a message after each page, saying "Press return to continue".
  171. Ignore this: the return is issued automatically when you close the page
  172. window. I ought really to take this out, but I'm too lazy.
  173.  
  174. If you are processing a long file and you decide to abandon it, the only way
  175. is to  get the task manager window up and force GS to quit from that. This
  176. can also be used as a last resort if "Quit" on the menus doesn't seem to
  177. work (which means that the PostScript command "quit" has somehow been
  178. overridden). Of course, if you've set fast mode, you can't get the task
  179. manager window up, until the page window appears at least, which is a bit of
  180. a shame.
  181.  
  182.  
  183. Inventory
  184. ---------
  185. The following files and directories make up the release:
  186.  !Help  - this file
  187.  !Run,  !RunImage,  !Sprites,  Templates - standard application files
  188.  *Arc-Make - Archimedes makefile
  189.  *c - main part of C source
  190.  *h - main part of C headers
  191.  *WimpPlus - my extra Wimp Library
  192.  *GLibVia,  ILibVia, MakeFile - files for building the release
  193.  COPYING,  License - GNU License agreement
  194.  README, doc - miscellaneous documentation
  195.  FONTMAP - font mappings
  196.  gsf - font files
  197.  gs_via - Linker "via" file
  198.  *Specific - various files used in other implementations only (including
  199. other device drivers)
  200.  ps - various PostScript files. Some of these can be run to produce pretty
  201. pictures. Ones to try are golfer, chess, escher. Escher is quite slow, and
  202. doesn't seem to leave the interpreter in a very clean state afterwards, so
  203. don't be surprised if things go wrong after running this file. Note that
  204. lines.ps (at least) contains more than one page.
  205.  
  206. To produce a minimal executable system, discard the files and
  207. directories marked with *.
  208.  
  209.  
  210. Nasties
  211. -------
  212. Here are some things wrong with the current implementation:
  213.  
  214. The output window is not perfect in the current version, and will flicker
  215. horribly if there is a lot of rapid output to it. You may see this on
  216. GhostScript errors which result in a stack trace.
  217.  
  218. The whole thing is rather slow. Partly this is in the main part of
  219. GhostScript, but the device code could probably be speeded up too.
  220.  
  221. If you run a long file, there's no way of breaking into it.
  222.  
  223.  
  224. Wish list for the next release
  225. ------------------------------
  226. Fix the "nasties".
  227.  
  228. Allow the page window to be displayed as it gets constructed (as, for
  229. example, the X windows version does). This would probably go in as an
  230. option, since it would make things *even slower*.
  231.  
  232. Add something to give a reassurance that GS is doing something during long
  233. processing.
  234.  
  235.  
  236. A note on copying
  237. -----------------
  238. GhostScript is distributed under the terms of the General Public License
  239. (GPL) devised by Richard Stallman. This can be found in the file COPYING.
  240. Under the terms of this license I am required to distribute or otherwise
  241. make available the source code. This includes both the code as distributed
  242. by the authors of GhostScript, and any additional code written by me. You
  243. will find this in the c, h and directories. WimpPlus contains my additional
  244. code for doing things like printf into a window. No warranty or support is
  245. offered with this code. You will need C release 4 if you intend to rebuild
  246. the program.
  247.  
  248. (Rant starts)
  249.  
  250. Personally, I find the clause of the Stallman GPL requiring the source code
  251. to be distributed somewhat objectionable. It replaces one form of control
  252. (that of the corporate state) by another (namely that of Stallman and the
  253. GNU conspiracy), albeit one which is more aimed towards the greater good.
  254. A significant part of the work of porting GhostScript was in writing
  255. WimpPlus. I could have chosen not to do this, and instead to leave it as a
  256. command line program. Or, I could have chosen to port the program and not
  257. distribute it. But, having decided that I would port it, add WimpPlus, and
  258. distribute it, I am not given an opportunity to decide at what level of my
  259. work should be made public.
  260.  
  261. On the other hand, I do freely give permission for WimpPlus to be used in
  262. programs other than GhostScript, provided it is understood that no support
  263. or warranty is offered. See the header files wimpc.h and wimpio.h for how to
  264. use it.
  265.  
  266. (Rant ends)
  267.  
  268.  
  269. I am:
  270.   David.Elworthy@cl.cam.ac.uk
  271.  also contactable as
  272.   David Elworthy,
  273.   18 Kimberley Road,
  274.   Cambridge CB4 1HH,
  275.   UK
  276.  
  277. Comments and suggestions for future versions are welcome.
  278.